Package-level declarations

Types

Link copied to clipboard
@Serializable
abstract class AbstractView(val horizFov: Double = 60.0)

This is an abstract element and cannot be used directly in a KML file. This element is extended by the Camera and LookAt elements.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "altitudeMode")
enum AltitudeMode : Enum<AltitudeMode>

Specifies how altitude components in the element are interpreted.

Link copied to clipboard
@Serializable
data class Camera(val longitude: Double = 0.0, val latitude: Double = 0.0, val altitude: Double = 0.0, val heading: Double = 0.0, val tilt: Double = 0.0, val roll: Double = 0.0, val altitudeMode: AltitudeMode = AltitudeMode.relativeToGround) : AbstractView

Defines the virtual camera that views the scene. This element defines the position of the camera relative to the Earth's surface as well as the viewing direction of the camera. The camera position is defined by longitude, latitude, altitude, and either altitudeMode. The viewing direction of the camera is defined by heading, tilt, and roll. Camera can be a child element of any Feature or of NetworkLinkControl. A parent element cannot contain both a Camera and a LookAt at the same time.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "colorMode")
enum ColorMode : Enum<ColorMode>

A value of random applies a random linear scale to the base as follows. To achieve a truly random selection of colors, specify a base of white (ffffffff). If you specify a single color component (for example, a value of ff0000ff for red), random color values for that one component (red) will be selected. In this case, the values would range from 00 (black) to ff (full red). If you specify values for two or for all three color components, a random linear scale is applied to each color component, with results ranging from black to the maximum values specified for each component. The opacity of a color comes from the alpha component of and is never randomized.

Link copied to clipboard
@Serializable
abstract class ColorStyle : Object

This is an abstract element and cannot be used directly in a KML file. It provides elements for specifying the color and color mode of extended style types.

Link copied to clipboard
@Serializable
abstract class Container(val features: List<Feature> = emptyList()) : Feature

This is an abstract element and cannot be used directly in a KML file. A Container element holds one or more Features and allows the creation of nested hierarchies.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "coordinates")
data class Coordinate(val value: String)

A single tuple consisting of floating point values for longitude, latitude, and altitude (in that order). Longitude and latitude values are in degrees, where

Link copied to clipboard
@Serializable
@XmlSerialName(value = "coordinates")
data class Coordinates(val value: String)
Link copied to clipboard
@Serializable
data class Data(val name: String, val displayName: String? = null, val value: String)

Creates an untyped name/value pair. The name can have two versions: name and displayName. The name attribute is used to identify the data pair within the KML file. The displayName element is used when a properly formatted name, with spaces and HTML formatting, is displayed in Google Earth. In the element of , the notation $name/displayName is replaced with . If you substitute the value of the name attribute of the element in this format (for example, $[holeYardage], the attribute value is replaced with . By default, the Placemark's balloon displays the name/value pairs associated with it.

Link copied to clipboard
@Serializable
data class Document(val id: String? = null, val schemas: List<Schema> = emptyList()) : Container

A Document is a container for features and styles. This element is required if your KML file uses shared styles. It is recommended that you use shared styles, which require the following steps:

Link copied to clipboard
@Serializable
data class ExtendedData(val data: List<Data> = emptyList(), val schemaData: SchemaData? = null)

The ExtendedData element offers three techniques for adding custom data to a KML Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document, Folder).

Link copied to clipboard
@Serializable
abstract class Feature(val name: String? = null, val visibility: Boolean = true, val open: Boolean = false, val address: String? = null, val phoneNumber: String? = null, val snippet: Snippet? = null, val description: String? = null, val abstractView: AbstractView? = null, val timePrimitive: TimePrimitive? = null, val styleUrl: String? = null, val styleSelector: List<StyleSelector> = emptyList(), val region: Region? = null, val extendedData: ExtendedData? = null) : Object

This is an abstract element and cannot be used directly in a KML file. The following diagram shows how some of a Feature's elements appear in Google Earth.

Link copied to clipboard
@Serializable
data class Folder(val id: String? = null) : Container

A Folder is used to arrange other Features hierarchically (Folders, Placemarks, NetworkLinks, or Overlays). A Feature is visible only if it and all its ancestors are visible.

Link copied to clipboard
@Serializable
abstract class Geometry : Object

This is an abstract element and cannot be used directly in a KML file. It provides a placeholder object for all derived Geometry objects.

Link copied to clipboard
@Serializable
data class GroundOverlay(val id: String? = null, val altitude: Double = 0.0, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val latLonBox: LatLonBox? = null, val latLonQuad: LatLonQuad? = null) : Overlay

This element draws an image overlay draped onto the terrain. The child of Icon specifies the image to be used as the overlay. This file can be either on a local file system or on a web server. If this element is omitted or contains no , a rectangle is drawn using the color and LatLonBox bounds defined by the ground overlay.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "hotSpot")
data class HotSpot(val x: Double, val y: Double, val xunits: HotSpotUnits = HotSpotUnits.fraction, val yunits: HotSpotUnits = HotSpotUnits.fraction)

Specifies the position within the Icon that is "anchored" to the specified in the Placemark. The x and y values can be specified in three different ways: as pixels ("pixels"), as fractions of the icon ("fraction"), or as inset pixels ("insetPixels"), which is an offset in pixels from the upper right corner of the icon. The x and y positions can be specified in different ways—for example, x can be in pixels and y can be a fraction. The origin of the coordinate system is in the lower left corner of the icon.

Link copied to clipboard
@Serializable
enum HotSpotUnits : Enum<HotSpotUnits>
Link copied to clipboard
@Serializable
data class Icon(val id: String? = null, val href: String, val x: Int = 0, val y: Int = 0, val w: Int = 0, val h: Int = 0, val refreshMode: RefreshMode = RefreshMode.onChange, val refreshInterval: Int = 4, val viewRefreshMode: ViewRefreshMode = ViewRefreshMode.never, val viewRefreshTime: Int = 4, val viewBoundScale: Float = 1.0f, val viewFormat: String? = null, val httpQuery: String? = null) : Object

Defines an image associated with an Icon style or overlay. The required child element defines the location of the image to be used as the overlay or as the icon for the placemark. This location can either be on a local file system or a remote web server. The gx:x, gx:y, gx:w, and gx:h elements are used to select one icon from an image that contains multiple icons (often referred to as an icon palette).

Link copied to clipboard
@Serializable
data class IconStyle(val id: String? = null, var color: String = "ffffffff", val colorMode: ColorMode = ColorMode.normal, val scale: Double = 1.0, val heading: Double = 0.0, val icon: Icon? = null, val hotSpot: HotSpot? = null) : ColorStyle

Specifies how icons for point Placemarks are drawn, both in the Places panel and in the 3D viewer of Google Earth. The Icon element specifies the icon image. The scale element specifies the x, y scaling of the icon. The color specified in the color element of IconStyle is blended with the color of the Icon.

Link copied to clipboard
@Serializable
@SerialName(value = "innerBoundaryIs")
data class InnerBoundaryIs(val value: List<LinearRing> = emptyList())

Contains a LinearRing element. A Polygon can contain multiple InnerBoundaryIs elements, which create multiple cut-outs inside the Polygon.

Link copied to clipboard
@Serializable
data class LabelStyle(val id: String? = null, var color: String = "ffffffff", val colorMode: ColorMode = ColorMode.normal, val scale: Float = 1.0f) : ColorStyle

Specifies how the Feature.name of a Feature is drawn in the 3D viewer. A custom color, color mode, and scale for the label (name) can be specified.

Link copied to clipboard
@Serializable
data class LatLonAltBox(val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val minAltitude: Double = 0.0, val maxAltitude: Double = 0.0, val north: Double, val south: Double, val east: Double, val west: Double)

A bounding box that describes an area of interest defined by geographic coordinates and altitudes.

Link copied to clipboard
@Serializable
data class LatLonBox(val north: Double, val south: Double, val east: Double, val west: Double, val rotation: Double = 0.0)

Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "LatLonQuad", namespace = "http://www.google.com/kml/ext/2.2", prefix = "gx")
data class LatLonQuad(val coordinates: Coordinates)

Allows nonrectangular quadrilateral ground overlays.

Link copied to clipboard
@Serializable
data class LinearRing(val id: String? = null, val altitudeOffset: Double = 0.0, val extrude: Boolean = false, val tessellate: Boolean = false, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val coordinates: Coordinates) : Geometry

Defines a closed line string, typically the outer boundary of a Polygon. Optionally, a LinearRing can also be used as the inner boundary of a Polygon to create holes in the Polygon. A Polygon can contain multiple LinearRing elements used as inner boundaries.

Link copied to clipboard
@Serializable
data class LineString(val id: String? = null, val altitudeOffset: Double = 0.0, val extrude: Boolean = false, val tessellate: Boolean = false, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val drawOrder: Int = 0, val coordinates: Coordinates) : Geometry

Defines a connected set of line segments. Use LineStyle to specify the color, color mode, and width of the line. When a LineString is extruded, the line is extended to the ground, forming a polygon that looks somewhat like a wall or fence. For extruded LineStrings, the line itself uses the current LineStyle, and the extrusion uses the current PolyStyle. See the KML Tutorial for examples of LineStrings (or paths).

Link copied to clipboard
@Serializable
data class LineStyle(val id: String? = null, var color: String = "ffffffff", val colorMode: ColorMode = ColorMode.normal, val width: Float = 1.0f, val outerColor: String = "ffffffff", val outerWidth: Float = 0.0f, val physicalWidth: Double = 0.0, val labelVisibility: Boolean = false) : ColorStyle

Specifies the drawing style (color, color mode, and line width) for all line geometry. Line geometry includes the outlines of outlined polygons and the extruded "tether" of Placemark icons (if extrusion is enabled).

Link copied to clipboard
@Serializable
data class Lod(val minLodPixels: Int, val maxLodPixels: Int = -1, val minFadeExtent: Int = 0, val maxFadeExtent: Int = 0)

Lod is an abbreviation for Level of Detail. Lod describes the size of the projected region on the screen that is required in order for the region to be considered "active." Also specifies the size of the pixel ramp used for fading in (from transparent to opaque) and fading out (from opaque to transparent). See diagram below for a visual representation of these parameters.

Link copied to clipboard
@Serializable
data class LookAt(val longitude: Double = 0.0, val latitude: Double = 0.0, val altitude: Double = 0.0, val heading: Double = 0.0, val tilt: Double = 0.0, val range: Double, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround) : AbstractView

Defines a virtual camera that is associated with any element derived from Feature. The LookAt element positions the "camera" in relation to the object that is being viewed. In Google Earth, the view "flies to" this LookAt viewpoint when the user double-clicks an item in the Places panel or double-clicks an icon in the 3D viewer.

Link copied to clipboard
@Serializable
data class MultiGeometry(val id: String? = null, val geometries: List<Geometry> = emptyList()) : Geometry

A container for zero or more geometry primitives associated with the same feature.

Link copied to clipboard
@Serializable
abstract class Object
Link copied to clipboard
@Serializable
@SerialName(value = "outerBoundaryIs")
data class OuterBoundaryIs(val value: LinearRing)

Contains a LinearRing element.

Link copied to clipboard
@Serializable
abstract class Overlay(val color: String? = null, val drawOrder: Int = 0, val icon: Icon? = null) : Feature

This is an abstract element and cannot be used directly in a KML file. is the base type for image overlays drawn on the planet surface or on the screen. specifies the image to use and can be configured to reload images based on a timer or by camera changes. This element also includes specifications for stacking order of multiple overlays and for adding color and transparency values to the base image.

Link copied to clipboard
@Serializable
data class Placemark(val id: String? = null, val geometries: List<Geometry> = emptyList()) : Feature

A Placemark is a Feature with associated Geometry. In Google Earth, a Placemark appears as a list item in the Places panel. A Placemark with a Point has an icon associated with it that marks a point on the Earth in the 3D viewer. (In the Google Earth 3D viewer, a Point Placemark is the only object you can click or roll over. Other Geometry objects do not have an icon in the 3D viewer. To give the user something to click in the 3D viewer, you would need to create a MultiGeometry object that contains both a Point and the other Geometry object.)

Link copied to clipboard
@Serializable
data class Point(val id: String? = null, val extrude: Boolean = false, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val coordinates: Coordinate) : Geometry

A geographic location defined by longitude, latitude, and (optional) altitude. When a Point is contained by a Placemark, the point itself determines the position of the Placemark's name and icon. When a Point is extruded, it is connected to the ground with a line. This "tether" uses the current LineStyle.

Link copied to clipboard
@Serializable
data class Polygon(val id: String? = null, val extrude: Boolean = false, val tessellate: Boolean = false, val altitudeMode: AltitudeMode = AltitudeMode.clampToGround, val outerBoundaryIs: OuterBoundaryIs? = null, val innerBoundaryIs: InnerBoundaryIs? = null) : Geometry

A Polygon is defined by an outer boundary and 0 or more inner boundaries. The boundaries, in turn, are defined by LinearRings. When a Polygon is extruded, its boundaries are connected to the ground to form additional polygons, which gives the appearance of a building or a box. Extruded Polygons use PolyStyle for their color, color mode, and fill.

Link copied to clipboard
@Serializable
data class PolyStyle(val id: String? = null, var color: String = "ffffffff", val colorMode: ColorMode = ColorMode.normal, val fill: Boolean = true, val outline: Boolean = true) : ColorStyle

Specifies the drawing style for all polygons, including polygon extrusions (which look like the walls of buildings) and line extrusions (which look like solid fences).

Link copied to clipboard
@Serializable
@XmlSerialName(value = "refreshMode")
enum RefreshMode : Enum<RefreshMode>

Specifies a time-based refresh mode

Link copied to clipboard
@Serializable
data class Region(val id: String? = null, val latLonAltBox: LatLonAltBox, val lod: Lod? = null) : Object

A region contains a bounding box (LatLonAltBox) that describes an area of interest defined by geographic coordinates and altitudes. In addition, a Region contains an LOD (level of detail) extent (Lod) that defines a validity range of the associated Region in terms of projected screen size. A Region is said to be "active" when the bounding box is within the user's view and the LOD requirements are met. Objects associated with a Region are drawn only when the Region is active. When the is onRegion, the Link or Icon is loaded only when the Region is active. See the "Topics in KML" page on Regions for more details. In a Container or NetworkLink hierarchy, this calculation uses the Region that is the closest ancestor in the hierarchy.

Link copied to clipboard
@Serializable
data class Schema(val id: String, val name: String? = null, val simpleFields: List<SimpleField> = emptyList())

Specifies a custom KML schema that is used to add custom data to KML Features. The id attribute is required and must be unique within the KML file. Schema is always a child of Document.

Link copied to clipboard
@Serializable
data class SchemaData(val schemaUrl: String? = null, val simpleData: List<SimpleData> = emptyList())

This element is used in conjunction with Schema to add typed custom data to a KML Feature. The Schema element (identified by the schemaUrl attribute) declares the custom data type. The actual data objects ("instances" of the custom data) are defined using the SchemaData element.

Link copied to clipboard
@Serializable
data class SimpleData(val name: String, val value: String)

This element assigns a value to the custom data field identified by the name attribute. The type and name of this custom data field are declared in the Schema element.

Link copied to clipboard
@Serializable
data class SimpleField(val type: String, val name: String, val displayName: String? = null)

A Schema element contains one or more SimpleField elements. In the SimpleField, the Schema declares the type and name of the custom field. It optionally specifies a displayName (the user-friendly form, with spaces and proper punctuation used for display in Google Earth) for this custom field.

Link copied to clipboard
@Serializable
data class Snippet(val value: String, val maxLines: Int = 2)

A short description of the feature. In Google Earth, this description is displayed in the Places panel under the name of the feature. If a Snippet is not supplied, the first two lines of the Feature.description are used. In Google Earth, if a Placemark contains both a description and a Snippet, the appears beneath the Placemark in the Places panel, and the appears in the Placemark's description balloon. This tag does not support HTML markup. has a maxLines attribute, an integer that specifies the maximum number of lines to display.

Link copied to clipboard
@Serializable
data class Style(val id: String? = null, val styles: List<ColorStyle> = emptyList()) : StyleSelector

A Style defines an addressable style group that can be referenced by StyleMaps and Features. Styles affect how Geometry is presented in the 3D viewer and how Features appear in the Places panel of the List view. Shared styles are collected in a and must have an id defined for them so that they can be referenced by the individual Features that use them.

Link copied to clipboard
@Serializable
data class StyleMap(val id: String? = null, val pairs: List<StylePair>) : StyleSelector

A StyleMap maps between two different Styles. Typically a StyleMap element is used to provide separate normal and highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon in Google Earth.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "Pair")
data class StylePair(val key: String, val styleUrl: String)

Defines a key/value pair that maps a mode (normal or highlight) to the predefined .

Link copied to clipboard
@Serializable
abstract class StyleSelector : Object

This is an abstract element and cannot be used directly in a KML file. It is the base type for the Style and StyleMap elements. The StyleMap element selects a style based on the current mode of the Placemark. An element derived from StyleSelector is uniquely identified by its id and its url.

Link copied to clipboard
@Serializable
abstract class TimePrimitive : Object

This is an abstract element and cannot be used directly in a KML file. This element is extended by the TimeSpan and TimeStamp elements.

Link copied to clipboard
@Serializable
data class TimeSpan(val id: String? = null, val begin: String? = null, val end: String? = null) : TimePrimitive

Represents an extent in time bounded by begin and end dateTimes.

Link copied to clipboard
@Serializable
data class TimeStamp(val id: String? = null, val timestamp: String? = null) : TimePrimitive

Represents a single moment in time. This is a simple element and contains no children. Its value is a dateTime, specified in XML time (see XML Schema Part 2: Datatypes Second Edition). The precision of the TimeStamp is dictated by the dateTime value in the when element.

Link copied to clipboard
@Serializable
@XmlSerialName(value = "viewRefreshMode")
enum ViewRefreshMode : Enum<ViewRefreshMode>

Specifies how the link is refreshed when the "camera" changes.

Properties

Link copied to clipboard
const val GX_NAMESPACE: String
Link copied to clipboard
const val GX_PREFIX: String